<?php

// [ 项目 ]

namespace app\index\controller;
use app\index\controller\Base;
use think\Session;

class Project extends Base
{
    // 前置操作
    protected $beforeActionList = [
        'must_cyz',
    ];

    // 必须为创业者
    protected function must_cyz()
    {
        ( 1 == Session::get('member.role') ) || $this->redirect('@error/forbidden');
    }

    // ----------------------------------------------------------------------------

    // 一键融资
    // http://jzl.51dojob.com/project
    public function index()
    {
        $this->assign('action','project');
        return $this->fetch();
    }

    // 创建项目
    // http://jzl.51dojob.com/project/create
    public function create()
    {
    	$this->assign('action','create');
        return $this->fetch();
    }

    // 编辑项目
    // http://jzl.51dojob.com/project/edit/ID
    public function edit($id = 0)
    {
        $this->assign('id',$id);
    	$this->assign('action','edit_project');
        return $this->fetch();
    }

    // 项目评估
    // http://jzl.51dojob.com/project/cp/ID
    public function cp()
    {
    	$this->assign('action','cp');
        return $this->fetch();
    }
    // 编辑项目评估
    // http://jzl.51dojob.com/project/cp/edit/ID
    public function cp_edit($id = 0)
    {
        $this->assign('id',$id);
    	$this->assign('action','edit_cp');
        return $this->fetch('cp');
    }

    // 项目评估历史报告
    // http://jzl.51dojob.com/project/cphistory/ID
    public function cphistory($id = 0)
    {
        $this->assign('id',$id);
        return $this->fetch();
    }

    // 高级评估列表
    // http://jzl.51dojob.com/project/vplist
    public function vplist()
    {
        return $this->fetch();
    }
}